#pragma once
#include "Kind.hpp"
#include <string>
#include <unordered_map>

class Keyword
{

public:
    Keyword()
    {
        allKeyword["do"] = SyntaxKind::Do;
        allKeyword["to"] = SyntaxKind::To;
        allKeyword["if"] = SyntaxKind::If;
        allKeyword["var"] = SyntaxKind::Var;
        allKeyword["let"] = SyntaxKind::Let;
        allKeyword["for"] = SyntaxKind::For;
        allKeyword["else"] = SyntaxKind::Else;
        allKeyword["case"] = SyntaxKind::Case;
        allKeyword["true"] = SyntaxKind::True;
        allKeyword["false"] = SyntaxKind::False;
        allKeyword["break"] = SyntaxKind::Break;
        allKeyword["while"] = SyntaxKind::While;
        allKeyword["switch"] = SyntaxKind::Switch;
        allKeyword["default"] = SyntaxKind::Default;

        allKeyword["continue"] = SyntaxKind::Countinue;
    }
    SyntaxKind isKeyWord(std::string str)
    {

        auto it = allKeyword.find(str);
        if (it != allKeyword.end())
        {
            return it->second;
        }
        return SyntaxKind::Unkown;
    }

private:
    std::unordered_map<std::string, SyntaxKind> allKeyword;
};